/**
 * Created by Jackie.Chen on 2017/5/20.
 */
'use strict'

var leftTemplete = require('html!./leftMenu.html');
require('../../css/leftMenu.less');
module.exports = {
  template: leftTemplete,
  data: function() {
    return {
      isActive:true,
      isModel: localStorage.getItem("isModel") === 'true'
    }
  },
  watch:{
    "$route":"getState"
  },
  mounted:function(){
    this.initHeight();
  },
  methods:{
    initHeight:function(){
      $('.left-menu').css({
        minHeight:310,//document.body.offsetHeight-104,
        height:$('.right-content').height()
      });
    },
    getState:function(){
     this.isModel = (this.$route.path === '/product/modelDe' ||  this.$route.path === '/product/dataExplore' ||  this.$route.path === '/product/dataType' ||  this.$route.path === '/product/modelEva' ||  this.$route.path === '/product/result');
      localStorage.setItem("isModel",this.isModel);
      this.initHeight();
    },
    changeIsActive:function(){
      this.isActive=true;
    },
    changeIsActiveNo:function(){
      this.isActive=false;
    }
  }
};
